const initialState = {
  sologan: '青青子衿',
}

//创建reducer函数math
const reducerName = (state = initialState, action) => {
  switch (action.type) {
    case 'CREATE_FRONT':
      return Object.assign({}, state, { sologan: action.str + state.sologan })   //对象拷贝并作部分修改
    case 'CREATE_BACK':
      return { ...state, sologan: state.sologan + action.str }       //对象拷贝并作部分修改
    default:
      return state
  }
}

export default reducerName;
